import {createRouter,createWebHistory} from "vue-router"
import routes from  './routes.js'

import nProgress from 'nprogress';
import 'nprogress/nprogress.css';

const router = createRouter({
	history: createWebHistory(),
	routes,
})
router.addRoute({ path: '/404', component:()=> import('@/view/Capture/404.vue'), name: 'NotFound' });
router.addRoute({ path: '/:pathMatch(.*)*', redirect: '/404' })





// 添加路由守卫
router.beforeEach((to, from, next) => {
	//开启进度条
	nProgress.start();
	next()
})

router.afterEach((to, from) => {
	//关闭进度条
	nProgress.done();
})









export default router

